﻿// Copyright: IMIP-CMCSoft
// Author: Huydq
// Date: Jul-15th-2009

using System.Configuration;
using System.Collections.Specialized;

namespace CommerceOne.Common.Configs
{
    /// <summary>
    /// Tien 15-Oct: Correct name of method GetConnectionStrings.
    /// </summary>
    public class ConfigurationManagerWrapper:IConfigurationManager
    {
        #region IConfiguration Members

        public NameValueCollection AppSettings
        {
            get { return ConfigurationManager.AppSettings; }
        }

        public string GetConnectionStrings(string name)
        {
            return ConfigurationManager.ConnectionStrings[name].ConnectionString;
        }

        public T GetSection<T>(string sectionName)
        {
            return (T)ConfigurationManager.GetSection(sectionName);
        }


        #endregion
    }
}